
import { iRouteInfo } from '@/interface/iRouteInfo';
import { Paxios } from '../base';
import { iReqLogin, iRespLogin } from '@/interface/login';

/**
 * 登录
 * @param url
 * @param params
 * @returns
 */
export function login(params: iReqLogin): Promise<iRespBase<iRespLogin>> {
    return Paxios.getInstance().get('/admin/Admin/login', params);
}



/**
 * 退出账号
 * @returns
 */
export function apiLogOut(): Promise<iRespBase<void>> {
    return Paxios.getInstance().post('/admin/admin/loginOut');
}


/**
 * 获取用户的路由权限
 * @returns
 */
export function apiAsyncAuth(): Promise<iRespBase<iRouteInfo[]>> {
    //TODO 待提供接口
    // return Paxios.getInstance().get('/admin/frontAuth/userauths');
    return Promise.resolve({
        code: 0,
        msg: "",
        data: JSON.parse('[{"name":"hotels","path":"/hotels","meta":{"menu_show":true,"menu_type":"top_menu","normal":"https://static.lingzhuyunpms.cn/cashier/assets/images/menus/room.png","hover":"https://static.lingzhuyunpms.cn/cashier/assets/images/menus/room_hover.png","parentPath":"","sort":1,"title":"酒店管理","elements":[]}},{"name":"hotel_list","path":"/hotels/hotel","meta":{"menu_show":true,"menu_type":"page","title":"酒店列表","parentPath":"/hotels","sort":1}},{"name":"system","path":"/system","meta":{"menu_show":true,"menu_type":"top_menu","normal":"https://static.lingzhuyunpms.cn/cashier/assets/images/menus/room.png","hover":"https://static.lingzhuyunpms.cn/cashier/assets/images/menus/room_hover.png","parentPath":"","sort":1,"title":"系统管理","elements":[]}},{"name":"sys_logs","path":"/system/sys_logs","meta":{"menu_show":true,"menu_type":"page","parentPath":"/system","title":"系统日志"}},{"name":"sys_log_detail","path":"/system/sys_logs/detail","meta":{"menu_show":false,"menu_type":"page","parentPath":"/system/sys_logs","title":"日志详情"}},{"name":"sys_account","path":"/system/account","meta":{"menu_show":true,"menu_type":"page","parentPath":"/system","title":"个人信息"}}]')
    })
    // export function apiAsyncAuth(): Promise<iRespBase<any[]>> {
    // return Promise.resolve({
    //   code: 0,
    //   data: [{"name":"room_status","path":"/main","meta":{"menu_show":true,"menu_type":"page","normal":"/src/assets/images/member.png","hover":"/src/assets/images/member_hover.png","parentPath":"","sort":1,"title":"房态管理","elements":[{"key":"detail","label":"详情按钮","local_path":"/main"}]}},{"name":"room_order","path":"/order_center","meta":{"menu_show":true,"menu_type":"page","normal":"/src/assets/images/order.png","hover":"/src/assets/images/order_hover.png","parentPath":"","sort":2,"title":"订单中心"}},{"name":"computer","path":"/computer","meta":{"menu_show":true,"menu_type":"page","normal":"/src/assets/images/computer.png","hover":"/src/assets/images/computer_hover.png","parentPath":"","sort":3,"title":"电脑管理"}},{"name":"shift","path":"/shift_management","meta":{"menu_show":true,"menu_type":"page","normal":"/src/assets/images/shift.png","parentPath":"","hover":"/src/assets/images/shift_hover.png","sort":4,"title":"交班管理"}},{"name":"vip","path":"/member_manager","meta":{"menu_show":true,"menu_type":"page","normal":"/src/assets/images/member.png","hover":"/src/assets/images/member_hover.png","parentPath":"","sort":5,"title":"会员管理"}},{"name":"supermarket","path":"/shop_market","meta":{"menu_show":true,"menu_type":"top_menu","normal":"/src/assets/images/shop_market.png","hover":"/src/assets/images/shop_market_hover.png","sort":6,"title":"商超管理"}},{"name":"goods_list","path":"/shop_market/goods_list","meta":{"menu_show":true,"menu_type":"second_page","parentPath":"/shop_market","sort":0,"title":"商品列表"}},{"name":"market_orders","path":"/shop_market/market_orders","meta":{"menu_show":true,"menu_type":"second_page","parentPath":"/shop_market","sort":1,"title":"商超订单"}},{"name":"instock_manage","path":"/shop_market/instock_manage","meta":{"menu_show":true,"menu_type":"second_page","parentPath":"/shop_market","sort":2,"title":"库存管理"}},{"name":"room_replenish","path":"/shop_market/room_replenish","meta":{"menu_show":true,"menu_type":"second_page","parentPath":"/shop_market","sort":3,"title":"房间补货"}},{"name":"online_pay","path":"/online_pay","meta":{"menu_show":true,"menu_type":"page","normal":"/src/assets/images/online_pay.png","hover":"/src/assets/images/online_pay_hover.png","parentPath":"","sort":7,"title":"在线支付订单"}}],
    //   msg: ""
    // })
}

